home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / dev / c / CLib-SDI.lha / CLib-SDI / include2mos / inline / utility_protos.h < prev   
C/C++ Source or Header  |  2002-10-27  |  12KB  |  398 lines

  1. #ifndef _VBCCINLINE_UTILITY_H
  2. #define _VBCCINLINE_UTILITY_H
  3.  
  4. #ifndef EXEC_TYPES_H
  5. #include <exec/types.h>
  6. #endif
  7.  
  8. struct TagItem * __FindTagItem(struct UtilityBase *, Tag tagVal, const struct TagItem * tagList) =
  9.     "\tlwz\t11,100(2)\n"
  10.     "\tstw\t3,56(2)\n"
  11.     "\tmtlr\t11\n"
  12.     "\tstw\t4,0(2)\n"
  13.     "\tstw\t5,32(2)\n"
  14.     "\tli\t3,-30\n"
  15.     "\tblrl";
  16. #define FindTagItem(tagVal, tagList) __FindTagItem(UtilityBase, (tagVal), (tagList))
  17.  
  18. ULONG __GetTagData(struct UtilityBase *, Tag tagValue, ULONG defaultVal, const struct TagItem * tagList) =
  19.     "\tlwz\t11,100(2)\n"
  20.     "\tstw\t3,56(2)\n"
  21.     "\tmtlr\t11\n"
  22.     "\tstw\t4,0(2)\n"
  23.     "\tstw\t5,4(2)\n"
  24.     "\tstw\t6,32(2)\n"
  25.     "\tli\t3,-36\n"
  26.     "\tblrl";
  27. #define GetTagData(tagValue, defaultVal, tagList) __GetTagData(UtilityBase, (tagValue), (defaultVal), (tagList))
  28.  
  29. ULONG __PackBoolTags(struct UtilityBase *, ULONG initialFlags, const struct TagItem * tagList, const struct TagItem * boolMap) =
  30.     "\tlwz\t11,100(2)\n"
  31.     "\tstw\t3,56(2)\n"
  32.     "\tmtlr\t11\n"
  33.     "\tstw\t4,0(2)\n"
  34.     "\tstw\t5,32(2)\n"
  35.     "\tstw\t6,36(2)\n"
  36.     "\tli\t3,-42\n"
  37.     "\tblrl";
  38. #define PackBoolTags(initialFlags, tagList, boolMap) __PackBoolTags(UtilityBase, (initialFlags), (tagList), (boolMap))
  39.  
  40. struct TagItem * __NextTagItem(struct UtilityBase *, struct TagItem ** tagListPtr) =
  41.     "\tlwz\t11,100(2)\n"
  42.     "\tstw\t3,56(2)\n"
  43.     "\tmtlr\t11\n"
  44.     "\tstw\t4,32(2)\n"
  45.     "\tli\t3,-48\n"
  46.     "\tblrl";
  47. #define NextTagItem(tagListPtr) __NextTagItem(UtilityBase, (tagListPtr))
  48.  
  49. VOID __FilterTagChanges(struct UtilityBase *, struct TagItem * changeList, struct TagItem * originalList, ULONG apply) =
  50.     "\tlwz\t11,100(2)\n"
  51.     "\tstw\t3,56(2)\n"
  52.     "\tmtlr\t11\n"
  53.     "\tstw\t4,32(2)\n"
  54.     "\tstw\t5,36(2)\n"
  55.     "\tstw\t6,0(2)\n"
  56.     "\tli\t3,-54\n"
  57.     "\tblrl";
  58. #define FilterTagChanges(changeList, originalList, apply) __FilterTagChanges(UtilityBase, (changeList), (originalList), (apply))
  59.  
  60. VOID __MapTags(struct UtilityBase *, struct TagItem * tagList, const struct TagItem * mapList, ULONG mapType) =
  61.     "\tlwz\t11,100(2)\n"
  62.     "\tstw\t3,56(2)\n"
  63.     "\tmtlr\t11\n"
  64.     "\tstw\t4,32(2)\n"
  65.     "\tstw\t5,36(2)\n"
  66.     "\tstw\t6,0(2)\n"
  67.     "\tli\t3,-60\n"
  68.     "\tblrl";
  69. #define MapTags(tagList, mapList, mapType) __MapTags(UtilityBase, (tagList), (mapList), (mapType))
  70.  
  71. struct TagItem * __AllocateTagItems(struct UtilityBase *, ULONG numTags) =
  72.     "\tlwz\t11,100(2)\n"
  73.     "\tstw\t3,56(2)\n"
  74.     "\tmtlr\t11\n"
  75.     "\tstw\t4,0(2)\n"
  76.     "\tli\t3,-66\n"
  77.     "\tblrl";
  78. #define AllocateTagItems(numTags) __AllocateTagItems(UtilityBase, (numTags))
  79.  
  80. struct TagItem * __CloneTagItems(struct UtilityBase *, const struct TagItem * tagList) =
  81.     "\tlwz\t11,100(2)\n"
  82.     "\tstw\t3,56(2)\n"
  83.     "\tmtlr\t11\n"
  84.     "\tstw\t4,32(2)\n"
  85.     "\tli\t3,-72\n"
  86.     "\tblrl";
  87. #define CloneTagItems(tagList) __CloneTagItems(UtilityBase, (tagList))
  88.  
  89. VOID __FreeTagItems(struct UtilityBase *, struct TagItem * tagList) =
  90.     "\tlwz\t11,100(2)\n"
  91.     "\tstw\t3,56(2)\n"
  92.     "\tmtlr\t11\n"
  93.     "\tstw\t4,32(2)\n"
  94.     "\tli\t3,-78\n"
  95.     "\tblrl";
  96. #define FreeTagItems(tagList) __FreeTagItems(UtilityBase, (tagList))
  97.  
  98. VOID __RefreshTagItemClones(struct UtilityBase *, struct TagItem * clone, const struct TagItem * original) =
  99.     "\tlwz\t11,100(2)\n"
  100.     "\tstw\t3,56(2)\n"
  101.     "\tmtlr\t11\n"
  102.     "\tstw\t4,32(2)\n"
  103.     "\tstw\t5,36(2)\n"
  104.     "\tli\t3,-84\n"
  105.     "\tblrl";
  106. #define RefreshTagItemClones(clone, original) __RefreshTagItemClones(UtilityBase, (clone), (original))
  107.  
  108. BOOL __TagInArray(struct UtilityBase *, Tag tagValue, const Tag * tagArray) =
  109.     "\tlwz\t11,100(2)\n"
  110.     "\tstw\t3,56(2)\n"
  111.     "\tmtlr\t11\n"
  112.     "\tstw\t4,0(2)\n"
  113.     "\tstw\t5,32(2)\n"
  114.     "\tli\t3,-90\n"
  115.     "\tblrl";
  116. #define TagInArray(tagValue, tagArray) __TagInArray(UtilityBase, (tagValue), (tagArray))
  117.  
  118. ULONG __FilterTagItems(struct UtilityBase *, struct TagItem * tagList, const Tag * filterArray, ULONG logic) =
  119.     "\tlwz\t11,100(2)\n"
  120.     "\tstw\t3,56(2)\n"
  121.     "\tmtlr\t11\n"
  122.     "\tstw\t4,32(2)\n"
  123.     "\tstw\t5,36(2)\n"
  124.     "\tstw\t6,0(2)\n"
  125.     "\tli\t3,-96\n"
  126.     "\tblrl";
  127. #define FilterTagItems(tagList, filterArray, logic) __FilterTagItems(UtilityBase, (tagList), (filterArray), (logic))
  128.  
  129. ULONG __CallHookPkt(struct UtilityBase *, struct Hook * hook, APTR object, APTR paramPacket) =
  130.     "\tlwz\t11,100(2)\n"
  131.     "\tstw\t3,56(2)\n"
  132.     "\tmtlr\t11\n"
  133.     "\tstw\t4,32(2)\n"
  134.     "\tstw\t5,40(2)\n"
  135.     "\tstw\t6,36(2)\n"
  136.     "\tli\t3,-102\n"
  137.     "\tblrl";
  138. #define CallHookPkt(hook, object, paramPacket) __CallHookPkt(UtilityBase, (hook), (object), (paramPacket))
  139.  
  140. VOID __Amiga2Date(struct UtilityBase *, ULONG seconds, struct ClockData * result) =
  141.     "\tlwz\t11,100(2)\n"
  142.     "\tstw\t3,56(2)\n"
  143.     "\tmtlr\t11\n"
  144.     "\tstw\t4,0(2)\n"
  145.     "\tstw\t5,32(2)\n"
  146.     "\tli\t3,-120\n"
  147.     "\tblrl";
  148. #define Amiga2Date(seconds, result) __Amiga2Date(UtilityBase, (seconds), (result))
  149.  
  150. ULONG __Date2Amiga(struct UtilityBase *, const struct ClockData * date) =
  151.     "\tlwz\t11,100(2)\n"
  152.     "\tstw\t3,56(2)\n"
  153.     "\tmtlr\t11\n"
  154.     "\tstw\t4,32(2)\n"
  155.     "\tli\t3,-126\n"
  156.     "\tblrl";
  157. #define Date2Amiga(date) __Date2Amiga(UtilityBase, (date))
  158.  
  159. ULONG __CheckDate(struct UtilityBase *, const struct ClockData * date) =
  160.     "\tlwz\t11,100(2)\n"
  161.     "\tstw\t3,56(2)\n"
  162.     "\tmtlr\t11\n"
  163.     "\tstw\t4,32(2)\n"
  164.     "\tli\t3,-132\n"
  165.     "\tblrl";
  166. #define CheckDate(date) __CheckDate(UtilityBase, (date))
  167.  
  168. LONG __SMult32(struct UtilityBase *, LONG arg1, LONG arg2) =
  169.     "\tlwz\t11,100(2)\n"
  170.     "\tstw\t3,56(2)\n"
  171.     "\tmtlr\t11\n"
  172.     "\tstw\t4,0(2)\n"
  173.     "\tstw\t5,4(2)\n"
  174.     "\tli\t3,-138\n"
  175.     "\tblrl";
  176. #define SMult32(arg1, arg2) __SMult32(UtilityBase, (arg1), (arg2))
  177.  
  178. ULONG __UMult32(struct UtilityBase *, ULONG arg1, ULONG arg2) =
  179.     "\tlwz\t11,100(2)\n"
  180.     "\tstw\t3,56(2)\n"
  181.     "\tmtlr\t11\n"
  182.     "\tstw\t4,0(2)\n"
  183.     "\tstw\t5,4(2)\n"
  184.     "\tli\t3,-144\n"
  185.     "\tblrl";
  186. #define UMult32(arg1, arg2) __UMult32(UtilityBase, (arg1), (arg2))
  187.  
  188. LONG __SDivMod32(struct UtilityBase *, LONG dividend, LONG divisor) =
  189.     "\tlwz\t11,100(2)\n"
  190.     "\tstw\t3,56(2)\n"
  191.     "\tmtlr\t11\n"
  192.     "\tstw\t4,0(2)\n"
  193.     "\tstw\t5,4(2)\n"
  194.     "\tli\t3,-150\n"
  195.     "\tblrl";
  196. #define SDivMod32(dividend, divisor) __SDivMod32(UtilityBase, (dividend), (divisor))
  197.  
  198. ULONG __UDivMod32(struct UtilityBase *, ULONG dividend, ULONG divisor) =
  199.     "\tlwz\t11,100(2)\n"
  200.     "\tstw\t3,56(2)\n"
  201.     "\tmtlr\t11\n"
  202.     "\tstw\t4,0(2)\n"
  203.     "\tstw\t5,4(2)\n"
  204.     "\tli\t3,-156\n"
  205.     "\tblrl";
  206. #define UDivMod32(dividend, divisor) __UDivMod32(UtilityBase, (dividend), (divisor))
  207.  
  208. LONG __Stricmp(struct UtilityBase *, CONST_STRPTR string1, CONST_STRPTR string2) =
  209.     "\tlwz\t11,100(2)\n"
  210.     "\tstw\t3,56(2)\n"
  211.     "\tmtlr\t11\n"
  212.     "\tstw\t4,32(2)\n"
  213.     "\tstw\t5,36(2)\n"
  214.     "\tli\t3,-162\n"
  215.     "\tblrl";
  216. #define Stricmp(string1, string2) __Stricmp(UtilityBase, (string1), (string2))
  217.  
  218. LONG __Strnicmp(struct UtilityBase *, CONST_STRPTR string1, CONST_STRPTR string2, LONG length) =
  219.     "\tlwz\t11,100(2)\n"
  220.     "\tstw\t3,56(2)\n"
  221.     "\tmtlr\t11\n"
  222.     "\tstw\t4,32(2)\n"
  223.     "\tstw\t5,36(2)\n"
  224.     "\tstw\t6,0(2)\n"
  225.     "\tli\t3,-168\n"
  226.     "\tblrl";
  227. #define Strnicmp(string1, string2, length) __Strnicmp(UtilityBase, (string1), (string2), (length))
  228.  
  229. UBYTE __ToUpper(struct UtilityBase *, ULONG character) =
  230.     "\tlwz\t11,100(2)\n"
  231.     "\tstw\t3,56(2)\n"
  232.     "\tmtlr\t11\n"
  233.     "\tstw\t4,0(2)\n"
  234.     "\tli\t3,-174\n"
  235.     "\tblrl";
  236. #define ToUpper(character) __ToUpper(UtilityBase, (character))
  237.  
  238. UBYTE __ToLower(struct UtilityBase *, ULONG character) =
  239.     "\tlwz\t11,100(2)\n"
  240.     "\tstw\t3,56(2)\n"
  241.     "\tmtlr\t11\n"
  242.     "\tstw\t4,0(2)\n"
  243.     "\tli\t3,-180\n"
  244.     "\tblrl";
  245. #define ToLower(character) __ToLower(UtilityBase, (character))
  246.  
  247. VOID __ApplyTagChanges(struct UtilityBase *, struct TagItem * list, const struct TagItem * changeList) =
  248.     "\tlwz\t11,100(2)\n"
  249.     "\tstw\t3,56(2)\n"
  250.     "\tmtlr\t11\n"
  251.     "\tstw\t4,32(2)\n"
  252.     "\tstw\t5,36(2)\n"
  253.     "\tli\t3,-186\n"
  254.     "\tblrl";
  255. #define ApplyTagChanges(list, changeList) __ApplyTagChanges(UtilityBase, (list), (changeList))
  256.  
  257. LONG __SMult64(struct UtilityBase *, LONG arg1, LONG arg2) =
  258.     "\tlwz\t11,100(2)\n"
  259.     "\tstw\t3,56(2)\n"
  260.     "\tmtlr\t11\n"
  261.     "\tstw\t4,0(2)\n"
  262.     "\tstw\t5,4(2)\n"
  263.     "\tli\t3,-198\n"
  264.     "\tblrl";
  265. #define SMult64(arg1, arg2) __SMult64(UtilityBase, (arg1), (arg2))
  266.  
  267. ULONG __UMult64(struct UtilityBase *, ULONG arg1, ULONG arg2) =
  268.     "\tlwz\t11,100(2)\n"
  269.     "\tstw\t3,56(2)\n"
  270.     "\tmtlr\t11\n"
  271.     "\tstw\t4,0(2)\n"
  272.     "\tstw\t5,4(2)\n"
  273.     "\tli\t3,-204\n"
  274.     "\tblrl";
  275. #define UMult64(arg1, arg2) __UMult64(UtilityBase, (arg1), (arg2))
  276.  
  277. ULONG __PackStructureTags(struct UtilityBase *, APTR pack, const ULONG * packTable, const struct TagItem * tagList) =
  278.     "\tlwz\t11,100(2)\n"
  279.     "\tstw\t3,56(2)\n"
  280.     "\tmtlr\t11\n"
  281.     "\tstw\t4,32(2)\n"
  282.     "\tstw\t5,36(2)\n"
  283.     "\tstw\t6,40(2)\n"
  284.     "\tli\t3,-210\n"
  285.     "\tblrl";
  286. #define PackStructureTags(pack, packTable, tagList) __PackStructureTags(UtilityBase, (pack), (packTable), (tagList))
  287.  
  288. ULONG __UnpackStructureTags(struct UtilityBase *, const APTR pack, const ULONG * packTable, struct TagItem * tagList) =
  289.     "\tlwz\t11,100(2)\n"
  290.     "\tstw\t3,56(2)\n"
  291.     "\tmtlr\t11\n"
  292.     "\tstw\t4,32(2)\n"
  293.     "\tstw\t5,36(2)\n"
  294.     "\tstw\t6,40(2)\n"
  295.     "\tli\t3,-216\n"
  296.     "\tblrl";
  297. #define UnpackStructureTags(pack, packTable, tagList) __UnpackStructureTags(UtilityBase, (pack), (packTable), (tagList))
  298.  
  299. BOOL __AddNamedObject(struct UtilityBase *, struct NamedObject * nameSpace, struct NamedObject * object) =
  300.     "\tlwz\t11,100(2)\n"
  301.     "\tstw\t3,56(2)\n"
  302.     "\tmtlr\t11\n"
  303.     "\tstw\t4,32(2)\n"
  304.     "\tstw\t5,36(2)\n"
  305.     "\tli\t3,-222\n"
  306.     "\tblrl";
  307. #define AddNamedObject(nameSpace, object) __AddNamedObject(UtilityBase, (nameSpace), (object))
  308.  
  309. struct NamedObject * __AllocNamedObjectA(struct UtilityBase *, CONST_STRPTR name, const struct TagItem * tagList) =
  310.     "\tlwz\t11,100(2)\n"
  311.     "\tstw\t3,56(2)\n"
  312.     "\tmtlr\t11\n"
  313.     "\tstw\t4,32(2)\n"
  314.     "\tstw\t5,36(2)\n"
  315.     "\tli\t3,-228\n"
  316.     "\tblrl";
  317. #define AllocNamedObjectA(name, tagList) __AllocNamedObjectA(UtilityBase, (name), (tagList))
  318.  
  319. #if !defined(NO_INLINE_STDARG) && (__STDC__ == 1L) && (__STDC_VERSION__ >= 199901L)
  320. struct NamedObject * __AllocNamedObject(struct UtilityBase *, long, long, long, long, long, long, CONST_STRPTR name, Tag tagList, ...) =
  321.     "\tlwz\t11,100(2)\n"
  322.     "\tstw\t3,56(2)\n"
  323.     "\tmtlr\t11\n"
  324.     "\tstw\t10,32(2)\n"
  325.     "\taddi\t4,1,8\n"
  326.     "\tstw\t4,36(2)\n"
  327.     "\tli\t3,-228\n"
  328.     "\tblrl";
  329. #define AllocNamedObject(name, ...) __AllocNamedObject(UtilityBase, 0, 0, 0, 0, 0, 0, (name), __VA_ARGS__)
  330. #endif
  331.  
  332. LONG __AttemptRemNamedObject(struct UtilityBase *, struct NamedObject * object) =
  333.     "\tlwz\t11,100(2)\n"
  334.     "\tstw\t3,56(2)\n"
  335.     "\tmtlr\t11\n"
  336.     "\tstw\t4,32(2)\n"
  337.     "\tli\t3,-234\n"
  338.     "\tblrl";
  339. #define AttemptRemNamedObject(object) __AttemptRemNamedObject(UtilityBase, (object))
  340.  
  341. struct NamedObject * __FindNamedObject(struct UtilityBase *, struct NamedObject * nameSpace, CONST_STRPTR name, struct NamedObject * lastObject) =
  342.     "\tlwz\t11,100(2)\n"
  343.     "\tstw\t3,56(2)\n"
  344.     "\tmtlr\t11\n"
  345.     "\tstw\t4,32(2)\n"
  346.     "\tstw\t5,36(2)\n"
  347.     "\tstw\t6,40(2)\n"
  348.     "\tli\t3,-240\n"
  349.     "\tblrl";
  350. #define FindNamedObject(nameSpace, name, lastObject) __FindNamedObject(UtilityBase, (nameSpace), (name), (lastObject))
  351.  
  352. VOID __FreeNamedObject(struct UtilityBase *, struct NamedObject * object) =
  353.     "\tlwz\t11,100(2)\n"
  354.     "\tstw\t3,56(2)\n"
  355.     "\tmtlr\t11\n"
  356.     "\tstw\t4,32(2)\n"
  357.     "\tli\t3,-246\n"
  358.     "\tblrl";
  359. #define FreeNamedObject(object) __FreeNamedObject(UtilityBase, (object))
  360.  
  361. STRPTR __NamedObjectName(struct UtilityBase *, struct NamedObject * object) =
  362.     "\tlwz\t11,100(2)\n"
  363.     "\tstw\t3,56(2)\n"
  364.     "\tmtlr\t11\n"
  365.     "\tstw\t4,32(2)\n"
  366.     "\tli\t3,-252\n"
  367.     "\tblrl";
  368. #define NamedObjectName(object) __NamedObjectName(UtilityBase, (object))
  369.  
  370. VOID __ReleaseNamedObject(struct UtilityBase *, struct NamedObject * object) =
  371.     "\tlwz\t11,100(2)\n"
  372.     "\tstw\t3,56(2)\n"
  373.     "\tmtlr\t11\n"
  374.     "\tstw\t4,32(2)\n"
  375.     "\tli\t3,-258\n"
  376.     "\tblrl";
  377. #define ReleaseNamedObject(object) __ReleaseNamedObject(UtilityBase, (object))
  378.  
  379. VOID __RemNamedObject(struct UtilityBase *, struct NamedObject * object, struct Message * message) =
  380.     "\tlwz\t11,100(2)\n"
  381.     "\tstw\t3,56(2)\n"
  382.     "\tmtlr\t11\n"
  383.     "\tstw\t4,32(2)\n"
  384.     "\tstw\t5,36(2)\n"
  385.     "\tli\t3,-264\n"
  386.     "\tblrl";
  387. #define RemNamedObject(object, message) __RemNamedObject(UtilityBase, (object), (message))
  388.  
  389. ULONG __GetUniqueID(struct UtilityBase *) =
  390.     "\tlwz\t11,100(2)\n"
  391.     "\tstw\t3,56(2)\n"
  392.     "\tmtlr\t11\n"
  393.     "\tli\t3,-270\n"
  394.     "\tblrl";
  395. #define GetUniqueID() __GetUniqueID(UtilityBase)
  396.  
  397. #endif /*  _VBCCINLINE_UTILITY_H  */
  398.